<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>操作管理</title>
	<meta name="decorator" content="default"/>
	<link rel="stylesheet" href="${ctxStatic}/ckfinder/plugins/gallery/colorbox/colorbox.css" />
	<script src="${ctxStatic}/ckfinder/plugins/gallery/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/cms/homePicture/">滚动图片列表</a></li>
		<shiro:hasPermission name="cms:homePicture:edit"><li><a href="${ctx}/cms/homePicture/form">滚动图片添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="homePicture" action="${ctx}/cms/homePicture/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>创建时间：</label>
				<input name="beginCreateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${homePicture.beginCreateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/> - 
				<input name="endCreateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${homePicture.endCreateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<%--<th>滚动图集</th>--%>
				<th>创建人</th>
				<th>创建时间</th>
				<%--<th>更新人</th>--%>
				<th>更新时间</th>
				<shiro:hasPermission name="cms:homePicture:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="homePicture">
			<tr>
				<%--<td><a href="${ctx}/cms/homePicture/form?id=${homePicture.id}">--%>
					<%--${homePicture.images}--%>
				<%--</a></td>--%>
				<td>
					${homePicture.user.name}
				</td>
				<td>
					<fmt:formatDate value="${homePicture.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<%--<td>--%>
					<%--${homePicture.updateBy.name}--%>
				<%--</td>--%>
				<td>
					<fmt:formatDate value="${homePicture.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>

				<shiro:hasPermission name="cms:homePicture:edit"><td>
					<a class="preview" href="javascript:void(0);" data-id="${homePicture.id}">预览</a>
					<c:forTokens items="${homePicture.images}" delims="|" var="str">
						<a class="group-${homePicture.id}" href="${str}" style="display: none;">pic1</a>
					</c:forTokens>
					<script type="text/javascript">
						$("a.group-${homePicture.id}").colorbox({rel: "group-${homePicture.id}",scalePhotos:true,maxWidth:400,maxHeight:800});
					</script>
    				<a href="${ctx}/cms/homePicture/form?id=${homePicture.id}">修改</a>
					<a href="${ctx}/cms/homePicture/delete?id=${homePicture.id}" onclick="return confirmx('确认要删除该操作吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
	<script type="text/javascript">
		$(document).ready(function() {
			$(".preview").click(function(){
//            alert("测试");
				$(".group-" + $(this).attr("data-id")).eq(0).click();
			});
		});
	</script>
</body>
</html>